home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / STANDALO / FUMBLE_F / MISC.C < prev   
Text File  |  1990-11-26  |  483b  |  31 lines

  1. uppercase(x)
  2.    int x;
  3.    /*** return (int) uppercase version of x ***/
  4.    {
  5.    if (x>='a' && x<='z') return(x-32);
  6.    else return(x);
  7.    }
  8.    
  9. char * strcpy()
  10.    {
  11.    asm {
  12.       movea.l    4(sp),a0        ;  A0 = s1
  13.       movea.l    8(sp),a1        ;  A1 = s2
  14.       move.l    a0,d0            ;  D0.L = result
  15. @1    move.b    (a1)+,(a0)+
  16.       bne.s    @1
  17.       }
  18.    }
  19.  
  20. int strlen(/* char *s */)
  21. {
  22.     asm {
  23.         moveq    #-1,d0            ;  D0.L = result
  24.         movea.l    4(sp),a0        ;  A0 = s
  25. @1        addq.l    #1,d0
  26.         tst.b    (a0)+
  27.         bne.s    @1
  28.     }
  29. }
  30.  
  31.